<?php

class UtilTemplate
{
    public static function adminDataList($dataTable = '', $title = '', $toolbarArray = array())
    {
        $html  = '<div class="row-fluid">';
        
        $html .=    '<div class="box span12">';
        
        $html .=        '<div class="box-header well">';
        
        $html .=            '<h2>'.$title.'</h2>';
        
        $html .=        '</div>';
        
        $html .=        '<div class="box-content">';
        
        $html .=            '<div class="dataTables_wrapper" role="grid">';
        
        if(Util::checkArray($toolbarArray))
        {
            $html .=                '<div class="row-fluid">';
        
            foreach($toolbarArray as $toolbar)
            {
                $html .=                    '<div class="span2">';

                $html .=                        '<div class="dataTables_length">';

                $html .=                            '<label>'.$toolbar.'</label>';

                $html .=                        '</div>';

                $html .=                    '</div>'; 
            }
                
            $html .=                '</div>';
        }
 
        $html .=                $dataTable;
        
        $html .=            '</div>';
        
        $html .=        '</div>';
        
        $html .=    '</div>';
        
        $html .= '</div>';
        
        return $html;
    }
    
    public static function adminIcon($iconArray = array())
    {
        
        if(!Util::checkArray($iconArray))
        {
            
            return FALSE;
        }
        
        $array = array();
        
        foreach($iconArray as $icon)
        {
            $array[] = 'icon-'.$icon;
        }
        
        return '<i class="'.implode(' ', $array).'"></i>';
    }
}